﻿/*
Fans数 
Time Limit:1000MS  Memory Limit:32768K


Description:
正整数的各位数字之和被fans称为Fans数。求输入数（<232）的Fans数!

Sample Input:
12345
56123
82Sample Output:
15
17
10
*/
#include <stdio.h>

unsigned int fans(unsigned long num)
{
	unsigned int sum=0;

	while (num)
	{
		sum+=num%10;
		num/=10u;
	}
	return sum;
}

int main(int argc, char* argv[])
{
	unsigned long num;
	
	while (EOF!=scanf("%u", &num))
	{
		printf("%u\n", fans(num));
	}
	return 0;
}